package com.massteam.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.massteam.dao.BaseDAO;
import com.massteam.pojo.DownloadHistory;
import com.massteam.service.DownloadHistoryService;

/**
 * @author 作者liuchengwei E-mail:liuchengwei98@163.com
 * @version 0.1
 * @since 创建时间：2012-1-6 下午04:44:37
 */
@Repository
public class DownloadHistoryServiceImpl implements DownloadHistoryService {
	@Autowired
	@Qualifier("baseDao")
	BaseDAO baseDao;

	public void addDownloadHistory(DownloadHistory downloadHistory) {
		baseDao.saveOrUpdate(downloadHistory);
	}

	public void delDownloadHistory(String id) {
		baseDao.delById(DownloadHistory.class, id);
	}

	@SuppressWarnings("unchecked")
	public List<DownloadHistory> queryDownloadHistory(String hql) {
		return (List<DownloadHistory>) baseDao.query(hql);
	}

	public void updateDownloadHistory(String hql) {
		baseDao.update(hql);
	}

	public DownloadHistory findDownloadHistoryById(String id) {
		return (DownloadHistory) baseDao.loadById(DownloadHistory.class, id);
	}

}
